package com.kanas.webak.admin.controller;
import java.util.HashMap;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.kanas.framework.support.ControllerSupport;

@Controller
@RequestMapping("/app/health/")
public class HealthController extends ControllerSupport {

	@RequestMapping(value="/jdkmemory",method=RequestMethod.GET)
	public @ResponseBody Map<String,Object> listAll(@RequestParam(value="start",required=false)Integer page,@RequestParam(value="count",required=false)Integer rows){
		Map<String,Object> response=new HashMap<String,Object>();
		response.put("max", Runtime.getRuntime().maxMemory());
		response.put("free", Runtime.getRuntime().freeMemory());
		response.put("total", Runtime.getRuntime().totalMemory());
		return response;
	}

}